<?php

declare(strict_types=1);
/**
 * This file is part of bearing-web.
 *
 * @link     https://www.bearing.cn/
 * @contact  tech@bearing.cn
 * @license  https://gitee.com/cppo/bearing_web/-/blob/master/README.md
 */
use yii\base\InvalidConfigException;
use yii\helpers\ArrayHelper;
use yii\web\Application;

require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/../../env.php';
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
require __DIR__ . '/../../common/config/bootstrap.php';
require __DIR__ . '/../config/bootstrap.php';

$config = ArrayHelper::merge(
    require __DIR__ . '/../../common/config/main.php',
    require __DIR__ . '/../config/main.php',
);
try {
    (new Application($config))->run();
} catch (InvalidConfigException $e) {
    exit($e->getMessage());
}
